package org.liveboardgames.agricola.control.delegates.mock.cards.actioncards
{
	import org.liveboardgames.agricola.control.delegates.mock.ActionFactory;
	import org.liveboardgames.agricola.model.enums.ActionOutputEnum;
	import org.liveboardgames.agricola.model.enums.ResourceZoneEnum;
	import org.liveboardgames.agricola.view.component.ImageHandler;
	import org.liveboardgames.agricola.vo.action.Action;
	import org.liveboardgames.agricola.vo.card.ActionCard;
	
	import mx.collections.ArrayCollection;
	import mx.collections.ListCollectionView;

	public class PeriodFourCards
	{
		public static const ONE_CATTLE:ActionCard = getOneCattleCard();
		public static const ONE_STONE:ActionCard = getOneStoneCard();

		private static function getOneCattleCard():ActionCard
		{
			var card:ActionCard = new ActionCard();
			card.imagePath = ImageHandler.ACTIONS + "OneCattle.png";
			card.resourceZone = ResourceZoneEnum.BOTTOM;

			// Build the actions
			var actions:ListCollectionView = new ArrayCollection();
			var action:Action = ActionFactory.getResourceAction(ActionOutputEnum.CATTLE, 1, true);
			action.target = card;
			action.needPlayerInput = false;
			actions.addItem(action);

			// A peep can take all accumulated animals
			var takeAction:Action = ActionFactory.getTakeAnimalAction(card);
			actions.addItem(takeAction);

			card.actions = actions;
			return card;
		}

		private static function getOneStoneCard():ActionCard
		{
			var card:ActionCard = new ActionCard();
			card.imagePath = ImageHandler.ACTIONS + "OneStone.png";
			card.cardName = "One stone (period 4) card";
			card.resourceZone = ResourceZoneEnum.BOTTOM;

			// Build the actions
			var actions:ListCollectionView = new ArrayCollection();
			var action:Action = ActionFactory.getResourceAction(ActionOutputEnum.STONE, 1, true);
			action.target = card;
			// A peep can take all accumulated resources
			var takeAction:Action = ActionFactory.getTakeAllAction(card);
			actions.addItem(action);
			actions.addItem(takeAction);

			card.actions = actions;
			return card;
		}
	}
}